/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.restaurant.domain;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author root
 */
@Entity
@Table(name = "employeetransaction")
@XmlRootElement(name = "employeetransaction")
@NamedQueries({
    @NamedQuery(name = "Employeetransaction.findAll", query = "SELECT e FROM Employeetransaction e"),
    @NamedQuery(name = "Employeetransaction.findByEmployeetransactionID", query = "SELECT e FROM Employeetransaction e WHERE e.employeetransactionID = :employeetransactionID"),
    @NamedQuery(name = "Employeetransaction.findByDescription", query = "SELECT e FROM Employeetransaction e WHERE e.description = :description"),
    @NamedQuery(name = "Employeetransaction.findByDatetime", query = "SELECT e FROM Employeetransaction e WHERE e.datetime = :datetime"),
    @NamedQuery(name = "Employeetransaction.findByAmount", query = "SELECT e FROM Employeetransaction e WHERE e.amount = :amount"),
    @NamedQuery(name = "Employeetransaction.findByIsdeleted", query = "SELECT e FROM Employeetransaction e WHERE e.isdeleted = :isdeleted")})
public class Employeetransaction implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "EmployeetransactionID")
    private Long employeetransactionID;
    @Column(name = "description")
    private String description;
    @Column(name = "datetime")
    @Temporal(TemporalType.TIMESTAMP)
    private Date datetime;
    @Column(name = "amount")
    private Double amount;
    @Column(name = "isdeleted")
    private Boolean isdeleted;
    @JoinColumn(name = "Tax_TaxID", referencedColumnName = "TaxID")
    @ManyToOne(optional = false)
    private Tax tax;
    @JoinColumn(name = "paymentmode_PaymentmodeID", referencedColumnName = "PaymentmodeID")
    @ManyToOne(optional = false)
    private Paymentmode paymentmode;
    @JoinColumn(name = "employee_EmployeeID", referencedColumnName = "EmployeeID")
    @ManyToOne(optional = false)
    private Employee employee;
    @JoinColumn(name = "transactiontype_TransactiontypeID", referencedColumnName = "TransactiontypeID")
    @ManyToOne(optional = false)
    private Transactiontype transactiontype;

    public Employeetransaction() {
    }

    public Employeetransaction(Long employeetransactionID) {
        this.employeetransactionID = employeetransactionID;
    }

    public Long getEmployeetransactionID() {
        return employeetransactionID;
    }

    public void setEmployeetransactionID(Long employeetransactionID) {
        this.employeetransactionID = employeetransactionID;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public Date getDatetime() {
        return datetime;
    }

    public void setDatetime(Date datetime) {
        this.datetime = datetime;
    }

    public Double getAmount() {
        return amount;
    }

    public void setAmount(Double amount) {
        this.amount = amount;
    }

    public Boolean getIsdeleted() {
        return isdeleted;
    }

    public void setIsdeleted(Boolean isdeleted) {
        this.isdeleted = isdeleted;
    }

    public Tax getTax() {
        return tax;
    }

    public void setTax(Tax tax) {
        this.tax = tax;
    }

    public Paymentmode getPaymentmode() {
        return paymentmode;
    }

    public void setPaymentmode(Paymentmode paymentmode) {
        this.paymentmode = paymentmode;
    }

    public Employee getEmployee() {
        return employee;
    }

    public void setEmployee(Employee employee) {
        this.employee = employee;
    }

    public Transactiontype getTransactiontype() {
        return transactiontype;
    }

    public void setTransactiontype(Transactiontype transactiontype) {
        this.transactiontype = transactiontype;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (employeetransactionID != null ? employeetransactionID.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Employeetransaction)) {
            return false;
        }
        Employeetransaction other = (Employeetransaction) object;
        if ((this.employeetransactionID == null && other.employeetransactionID != null) || (this.employeetransactionID != null && !this.employeetransactionID.equals(other.employeetransactionID))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.restaurant.domain.Employeetransaction[employeetransactionID=" + employeetransactionID + "]";
    }

}
